class RequeteSQL:
    def sqlStructureDB(self,):
        return "SELECT name,sql FROM sqlite_master; "
            
    def sqlInsert(self,table,valeurs):
        monsql="INSERT INTO "+table+" values ("
        for i in valeurs:
            monsql=monsql+i+", "
        monsql=monsql[:-2]+")"
        return monsql
    
    def sqlUpdate(self,table,col,valeur):
        pass
    def sqlDelete(self,enregistrement):
        if enregistrement == "*":
            "DELETE FROM choses where nom<>NULL"
    
    def sqlCreate(self,nomTable,cols):
        monsql="CREATE TABLE "+nomTable+" ("
        for i in cols:
            monsql=monsql+i[0]+" "+i[1]+", "
        monsql=monsql[:-2]+")"
        return monsql
    
    def sqlAlter(self,table,col,sorte, action):
        monsql="ALTER TABLE "+table+" "+action+" "+col +" "+sorte+";"
        return monsql
        
    def sqlDrop(self,table):
        monsql="DROP TABLE "+table+""
        return monsql
        
    def sqlSelect(self, table, cols="*",ou=[]):
        monsql="SELECT "+cols+" from "+table 
        if ou:
            monsql=monsql+" WHERE "+ou[0]+ou[1]+ou[2]
        monsql=monsql+""
        return monsql
    
    def sqlColumn(self, nomTable):
        monsql = self.sqlSelect( 'USER_CONS_COLUMNS', 'column_name', ['table_name', '=', "'" + nomTable+"'"])
        return monsql
